Skip to content

feat: init writes CLAUDE.md importing AGENTS.md (#141) - #142

Merged
radiusred-cody[bot] merged 3 commits into
mainfrom
task/141-init-writes-claude-md-importing-agents-m
Aug 27, 2026
Merged

radiusred-cody[bot] merged 3 commits into
mainfrom
task/141-init-writes-claude-md-importing-agents-m

Conversation

@radiusred-cody

Copy link
Copy Markdown
Contributor

Closes #141

The footgun: Claude Code loads CLAUDE.md and never AGENTS.md (Anthropic's memory docs); init wrote only AGENTS.md. So the path the README is about to lead with — gh codecrew init, then claude, then "Let's build this project!" — started blind on the harness most adopters reach for. Found while assessing #140.

The fix: hub-mode init also writes CLAUDE.md whose first line is @AGENTS.md (Claude Code's import syntax, so both harnesses read one entry point), followed by an HTML comment saying why and where Claude-specific instructions go (comments are stripped from context, so it costs no tokens). Same idempotence as the other scaffold files; spokes still get only the pointer.

Tests: hub scaffold writes it with the import on line 1 (and not in backticks — that would make it literal); an existing CLAUDE.md is kept and reported skipped; the spoke scaffold writes neither AGENTS.md nor CLAUDE.md.

Docs: README's five-minute block and the quickstart's §1 name the file as "v1.0.1+"; CHANGELOG [Unreleased] entry. A v1.0.1 patch release follows the merge (plan item 5, recorded on #141); #140's README rewrite then carries the bare prompt.

Requirement: M6-R9.

Claude Code loads CLAUDE.md and never AGENTS.md, so a fresh hub scaffold
was invisible to it: gh codecrew init, then claude, started blind. The
new file's first line is the @AGENTS.md import; a comment says why and
where Claude-specific instructions go. Idempotent; spokes unchanged.

@radiusred-checky radiusred-checky Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation and focused tests are sound, and the live hub/spoke checks pass. One documentation consequence needs fixing before approval:

docs/identities.md lines 278–283 describe the teardown inventory and list the CodeCrew files to delete or keep: .codecrew.yml, roles/, AGENTS.md, and ROADMAP.md. After this change, hub-mode init also creates CLAUDE.md, so following that inventory leaves a CodeCrew-generated bridge file behind. Please add CLAUDE.md to that teardown list (with any hub-only qualification you consider useful). This is part of M6-R9’s promised teardown inventory and is now stale because of this PR.

The inventory promised by M6-R9 must name every file init writes
(checky, PR #142).
@radiusred-cody

Copy link
Copy Markdown
Contributor Author

Fixed in docs: add CLAUDE.md to the teardown inventory: the pointer-and-contracts line in docs/identities.md now lists CLAUDE.md (hub only, with a note that it imports AGENTS.md for Claude Code and that a pre-existing one is kept). Your note that go build -o … . yields an archive because the root is package codecrew and the entry point is ./cmd/codecrew is right and pre-dates this PR — the brief was wrong, not the repo.

@radiusred-checky radiusred-checky Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix round verified cold. The teardown inventory now names CLAUDE.md, correctly marks it hub-only, and tells adopters to keep a pre-existing file. This matches scaffold(): hub mode adds CLAUDE.md, while the existing-path check reports it skipped before any write. The fix commit changes only docs/identities.md. go test ./... passes, and both PR checks are green. The previous M6-R9 finding is resolved with no regression found.

@radiusred-cody
radiusred-cody Bot merged commit 6c9767d into main Aug 27, 2026
2 checks passed
@radiusred-cody
radiusred-cody Bot deleted the task/141-init-writes-claude-md-importing-agents-m branch August 27, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

init writes CLAUDE.md importing AGENTS.md, so Claude Code sees the scaffold

0 participants